package com.lm.jsoup.example;


import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

public class JsoupModifyHtml {
    public static void main(String[] args) {
        String html = "<html><body><p>Original Paragraph</p></body></html>";

        // 解析 HTML
        Document document = Jsoup.parse(html);

        // 修改段落内容
        document.select("p").first().text("Updated Paragraph");

        // 输出修改后的 HTML
        System.out.println(document.html());
    }
}
